#'
#' remove rare species from the community
#'
#' @param com a community object
#' @param maxAb the maximun abundance below which is considered as rare species
#' 
#' 
#' @examples
#' set.seed(1)
#' 
#' splist=paste("sp",1:3,sep="")
#' spab=c(30,50,10)
#' com=rcommunity(splist,spab)
#' 
#' remove_rare_species(com,maxAb=40)
#' 
#' data(BCI)
#' remove_rare_species(BCI,maxAb=5)
#' 
#' @export
remove_rare_species=function(com,maxAb=10){
  spab=species_abundance(com)
  delsp=names(spab[spab<=maxAb])
  return(remove_species(com,delsp))
}